﻿CREATE TABLE [registration].[RegistrationLienHolder] (
    [RegistrationLienHolderID] INT          IDENTITY (1, 1) NOT NULL,
    [RegistrationID]           INT          NULL,
    [LienHolderID]             INT          NULL,
    [PrimaryLienHolder]        BIT          NULL,
    [CreatedBy]                VARCHAR (50) NULL,
    [CreatedDate]              DATETIME     NULL,
    [UpdatedBy]                VARCHAR (50) NULL,
    [UpdatedDate]              DATETIME     NULL,
    [EndDate]                  DATETIME     NULL,
    CONSTRAINT [PK_RegistrationLienHolder] PRIMARY KEY CLUSTERED ([RegistrationLienHolderID] ASC),
    CONSTRAINT [FK_RegistrationLienHolder_LienHolder] FOREIGN KEY ([LienHolderID]) REFERENCES [core].[LienHolder] ([LienHolderID]),
    CONSTRAINT [FK_RegistrationLienHolder_Registration] FOREIGN KEY ([RegistrationID]) REFERENCES [registration].[Registration] ([RegistrationID])
);

